#ifndef IVI_NL_H
#define IVI_NL_H

/* Attributes */
enum {
	IVI_NLA_NONE,
	IVI_NLA_V4ADDR,
	IVI_NLA_PLEN4,
	IVI_NLA_V6ADDR,
	IVI_NLA_PLEN6,
	IVI_NLA_RATIO,
	IVI_NLA_OFFSET,
	IVI_NLA_FORMAT,
	IVI_NLA_ROUTE,
	__IVI_NLA_MAX,
};

#define IVI_NLA_MAX (__IVI_NLA_MAX - 1)

/* Commands */
enum {
	IVI_NLC_NONE,
	IVI_NLC_CLOSE,
	IVI_NLC_RULE,    // used by kernel to request a rule and used by user daemon to reply a rule
	IVI_NLC_UPDATE,  // used by kernel to tell user daemon the local prefix is changed
	__IVI_NLC_MAX,
};

#define IVI_NLC_MAX (__IVI_NLC_MAX - 1)

#define IVI_FAMILY_NAME "NLF_IVI"
#define IVI_GROUP_NAME "IVI_NL_MC"
#define IVI_NL_VERSION 1

#ifdef __KERNEL__

#include <linux/module.h>
#include <net/ipv6.h>
#include <net/netlink.h>
#include <net/genetlink.h>
#include "ivi_rule.h"
#include "ivi_rule6.h"
#include "ivi_xmit.h"
#include "ivi_config.h"


extern int rule_lookup_request(u32 addr, u16 port, struct sk_buff *oskb, struct sk_buff *nskb);
extern int rule_update_request(u32 addr, u16 ratio, u16 offset, struct in6_addr *prefix, int plen6, struct in6_addr *router);

extern int notify_daemon(u32 addr, u16 port);
extern int notify_daemon_v6addr(struct in6_addr *addr);

extern int ivi_nl_init(void);
extern void ivi_nl_exit(void);

#endif

#endif /* IVI_NL_H */
